Find the number of divisors of a given integerΒΆ
Find the number of divisors of a given integer is even or odd.
def divisor(N):
for i in range(N):
x = len([i for i in range(1, N+1) if not N % i])
return x
print(divisor(15))
print(divisor(12))
print(divisor(9))
print(divisor(6))
print(divisor(3))
Output:
4
6
3
4
2